package Terminal.Entity.IceClasses;

import EntityCondivise.EPrivatoPrx;
import EntityCondivise.EPrivato;
import Ice.Communicator;
import Terminal.TechnicalServices.TSIce;

/**
 * Rappresenta il tipo di cliente privato.
 * @author Gruppo 6
 */
public class EPrivatoI extends EPrivato{
	TSIce iceComunicator;
	Communicator ice;
	EPrivatoPrx privato;		
	
	public EPrivatoI()
	{
		super();
		
		iceComunicator = Terminal.TechnicalServices.TSIce.istanza();
		ice = iceComunicator.getIce();
		
		try 
		{
	        Ice.ObjectPrx base = ice.stringToProxy("SimpleEPrivatoI:" + iceComunicator.getParametriConnessione());
	        privato = EntityCondivise.EPrivatoPrxHelper.checkedCast(base);
	        
	    	if (privato == null)
	        {   	
	        	throw new Error("Invalid proxy");
	        }	        
	        
		}
		catch (Ice.LocalException e) 
        {
            e.printStackTrace();
            iceComunicator.setStatus(1);
        } 
		catch (Exception e) 
		{
            System.err.println(e.getMessage());
            iceComunicator.setStatus(1);
        }				
	};
	
		
}
